add_executable(LnOpenGL "")


target_sources(LnOpenGL PRIVATE
  main.cpp
  glad/glad.cpp
  SnWindow.cpp
)

target_sources(LnOpenGL PRIVATE
  utils/util.cpp
  utils/SnTimer.cpp
  base/shader.cpp
  base/SnImage.cpp
  base/YUVImage.cpp
  base/YUVReader.cpp
)

target_sources(LnOpenGL PRIVATE
  SnRender.cpp
  render/TriangleRender.cpp
  render/SquareRender.cpp
  render/SquareRender2.cpp
  render/ColorPeriodRender.cpp
  render/VertexColorRender.cpp
  render/TextureRender.cpp
  render/TextureRender2.cpp
  render/TextureMixRender.cpp
  render/YUVRender.cpp
  render/YUVPboRender.cpp
  render/VideoPboRender.cpp
)

#设置头文件查找目录
target_include_directories(LnOpenGL PRIVATE 
  .
  ${COMMON_INC_DIR}
)

target_link_directories(LnOpenGL PRIVATE
  ${COMMON_LIB_DIR}
)

if (WIN32) 
  target_link_libraries(LnOpenGL PRIVATE
    glfw3.lib
    opengl32.lib
  )
elseif(APPLE)
  target_link_libraries(LnOpenGL PRIVATE
    glfw3.a
    "-framework Cocoa"
    "-framework OpenGL"
    "-framework IOKit"
    "-framework CoreVideo"
  )
endif()

